package com.cci.kangdao.controller;

import java.io.UnsupportedEncodingException;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.cci.kangdao.service.ActivityService;
import com.cci.kangdao.utilTool.ParameterTool;

@Controller
public class ActivitityController {

	private Logger log = Logger.getLogger(this.getClass().getName());
	
	@Autowired
	private ActivityService activityService;
	
	@RequestMapping("/activity.aspx")
	public ModelAndView addRecord(HttpServletRequest request, HttpServletResponse response) {
		
		try {
			Map<String, Object> map = ParameterTool.getParameterRequest(request, true);
			map.put("request", request);
			activityService.addRecord(map);
			
		} catch (UnsupportedEncodingException e) {
			log.error(e.getMessage(), e);
		}
		
		return new ModelAndView("install");
	}
	
	
}
